import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.Reader;

/**
 * @作者: xiaoxun
 * @日期: 2025/3/11 18:04
 * @描述: 文字输入流
 */
public class FileRaderDemo01 {
	public static void main(String[] args) throws Exception {
	//1、创建字符流对象
		Reader fr1=new FileReader("Day10\\src\\document01.txt");
		File file=new File("Day10\\src\\document01.txt");
		System.out.println(file.length());
		//2、读取一个字符编号回来
		int b1=fr1.read();
		System.out.println(b1);
		System.out.println((char) b1);
		int b2= fr1.read();
		System.out.println((char) b2);
		int b3;
//		char[] buffder=new char[(int) file.length()];
		while ((b3=fr1.read())!=-1){
			char c=(char) b3;
			System.out.print(c);
		}
	}
}
